package com.aop.demo.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.aop.demo.response.ResultCode;
import com.aop.demo.response.ResultObj;

@RestController
@RequestMapping("/httpRest")
public class HttpRestController {

    @GetMapping("/success")
    public ResultObj<?> success(){
        return ResultObj.success();
    }

    @GetMapping("/successWithData")
    public ResultObj<String> successWithData(){
        return ResultObj.success("成功返回数据");
    }

    @GetMapping("/failure")
    public ResultObj<?> failure(){
        return ResultObj.failure(ResultCode.PERMISSION_NO_ACCESS);
    }

}
